﻿<title>库存警示列表</title>
<link type="text/css" href="${ctx}/resources/css/ace.min.1.css"  rel="stylesheet" />
<div class="hr hr-5"></div>
<div class="row">
	<div class="col-xs-12">
		<div class="table-responsive">
			<table id="sample-table-1" class="table table-striped table-bordered table-hover">
				<thead>
					<tr>
						<th>ID</th>
						<th>商品名称</th>
						<th>商品单位</th>
						<th>库存总数</th>
						<th>警示数量</th>
						<th>仓库</th>
						<th>最近入库时间</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
				<#list pager.itemList as u>
					<tr>
						<td>${u.id}</td>
						<td>
							${u.goodsName!}
						</td>
						<td >
							<#if u.unit == 0>
							<#else>
								<span class="label label-sm label-warning arrowed">
									${dicSetting.getParameterValue("goods.unit." + u.unit)!}
								</span>
							</#if>
						</td>
						<td style="color:green;">
							${u.amount!}
						</td>
						<td style="color:red;">
							${u.rm!}
						</td>
						<td>
							<#if u.relativeId == 0>
								<a title="点击小区名称,可以查看小区库存分布情况." href="${ctx}/admin/stock/list?relativeId=${u.relativeId}" >平台</a>
							<#else>
								<@device cmd="get_estate_list">
									<#list estateList as o>
									<#if o.id == u.relativeId>
									<a title="点击小区名称,可以查看小区库存分布情况." href="${ctx}/admin/stock/list?relativeId=${u.relativeId}" >${o.name!}</a>
									</#if>
									</#list>
								</@device>
							</#if>
						</td>
						<td>
							<#if u.modifyTime??>
								${tagUtils.formatDate(u.modifyTime)!}
							<#else>
							${tagUtils.formatDate(u.createTime)!}
							</#if>
						</td>
						<td>
							<a href = "${ctx}/admin/record/add?goodsId=${u.goodsId}&relativeId=${u.relativeId}&amount=${u.rm - u.amount}">去配送</a>
						</td>
					</tr>
				</#list>
				</tbody>
			</table>
		</div>
	
		<div class="hr hr-18 dotted hr-double"></div>
		<@h.page pager=pager action="${ctx}/admin/stock/list${suffix}" />
	</div><!-- /span -->
</div><!-- /row -->

<#if errorMsg??>
	<div class="hr hr-18 hr-double dotted"></div>
	<h4 class="lighter">
		<i class="icon-hand-right icon-animated-hand-pointer red"></i>
		<span class="pink">${errorMsg!}</span>
	</h4>
</#if>

<#if infoMsg??>
	<div class="hr hr-18 hr-double dotted"></div>
	<h4 class="lighter">
		<i class="icon-hand-right icon-animated-hand-pointer green"></i>
		<span class="pink">${infoMsg}</span>
	</h4>
</#if>

<script>
$(document).ready(function(){
	RP.addBreadcrumb([ {name:"库存警示列表", active: true}]);
});
</script>